{% extends 'admin_dashboard.html' %}
{% block content %}
<div class="card">
  <h2>添加交易记录</h2>

  <form method="post">
    <div class="form-group">
      <label>交易时间：</label>
      <input type="datetime-local" name="timestamp" required>
    </div>

    <div class="form-group">
      <label>交易类型：</label>
      <select name="type" required>
        <option value="存款">存款</option>
        <option value="取款">取款</option>
      </select>
    </div>

    <div class="form-group">
      <label>卡号：</label>
      <select name="cardID" required>
        <option value="">-- 请选择 --</option>
        {% for card in cards %}
        <option value="{{ card.cardID }}">{{ card.cardID }}</option>
        {% endfor %}
      </select>
    </div>

    <div class="form-group">
      <label>交易金额：</label>
      <input type="number" step="0.01" name="amount" required>
    </div>

    <div class="form-group">
      <label>备注：</label>
      <input type="text" name="note" placeholder="例如：客户存入现金">
    </div>

    <button type="submit" class="btn">提交</button>
    <a href="{{ url_for('transactions') }}" class="btn">返回</a>
  </form>
</div>
{% endblock %}
